//数据格式注册——斗地主
module RegDataGamePublic {
    //BYTE,CHAR 1字节  TCHAR是char数组形式 如果是TCHAR是中文数据则用CHINESE
    //WORD 2字节
    //DWORD int LONG 4字节
    //SCORE 8字节
    //ID登陸
    export let heartCheck = {
        wMainCmdID: 0,
        wSubCmdID: 1,
        nLenght: 0,
        data: [

        ]
    }
    export let CMD_GP_LogonUserID = {
        wMainCmdID: 1,
        wSubCmdID: 1,
        nLenght: 69,
        data: [
            ["dwUserID", "DWORD"],      //ID登陸
            ["szPassword", "TCHAR", 33],        //登陆密码
            ["szMachineID", "TCHAR", 33],       //机器序列
        ]
    }


    //手机登陆
    export let CMD_GP_LogonMobile = {
        wMainCmdID: 1,
        wSubCmdID: 2,
        nLenght: 81,
        data: [
            ["wGameID", "WORD"],                //游戏标识
            ["dwProcessVersion", "DWORD"],       //远程版本
            ["cbDeviceType", "BYTE"],           //设备类型
            ["wBehaviorFlags", "WORD"],        //行为标识
            ["wPageTableCount", "WORD"],       //分页卓数
            ["dwUserID", "DWORD"],              //ID登陸
            ["szPassword", "TCHAR", 33],        //登陆密码
            ["szMachineID", "TCHAR", 33],       //机器序列
        ]
    }
    //账号登陆
    export let CMD_GP_LogonAccounts = {
        wMainCmdID: 1,
        wSubCmdID: 3,
        nLenght: 110,
        data: [
            ["dwPlazaVersion", "DWORD"],           //广场版本
            ["dwFrameVersion", "DWORD"],        //框架版本
            ["dwProcessVersion", "DWORD"],       //进程版本
            ["szPassword", "TCHAR", 33],              //账号密码
            ["szAccounts", "TCHAR", 32],        //登陆账号
            ["szMachineID", "TCHAR", 33],       //机器序列
        ]
    }
    //强行离开
    export let CMD_GP_LeaveGame = {
        wMainCmdID: 3,
        wSubCmdID: 4,
        nLenght: 5,
        data: [
            ["wTableID", "WORD"],      //桌子位置
            ["wChairID", "WORD"],      //椅子位置
            ["cbForceLeave", "BYTE"],      //强行离开 传1
        ]
    }
    //请求用户信息
    export let CMD_GP_UserInfoReq = {
        wMainCmdID: 3,
        wSubCmdID: 9,
        nLenght: 2,
        data: [
            ["wTablePos", "WORD"],      //桌子位置
        ]
    }
    //请求更换位置
    export let CMD_GP_UserChairReq = {
        wMainCmdID: 3,
        wSubCmdID: 10,
        nLenght: 0,
        data: [

        ]
    }
    //请求椅子用户信息
    export let CMD_GP_UserChairInfoReq = {
        wMainCmdID: 3,
        wSubCmdID: 11,
        nLenght: 2,
        data: [
            ["wTableID", "WORD"],      //桌子号码
            ["wChairID", "WORD"],      //椅子位置
        ]
    }
    //请求用户匹配
    export let CMD_GP_UserMate = {
        wMainCmdID: 3,
        wSubCmdID: 12,
        nLenght: 0,
        data: [

        ]
    }
    //请求快速坐下
    export let CMD_GP_UserQuickSitdown = {
        wMainCmdID: 3,
        wSubCmdID: 13,
        nLenght: 0,
        data: [

        ]
    }

    //请求退出
    export let CMD_GP_SuerLeave = {
        wMainCmdID: 3,
        wSubCmdID: 14,
        nLenght: 0,
        data: [

        ]
    }
    //app绑定
    export let CMD_GP_BindAppCode = {
        wMainCmdID: 3,
        wSubCmdID: 16,
        nLenght: 0,
        data: [
            ["cbBindType", "BYTE"],      //绑定类型 1-注册 2-登录
            ["dwUserID", "DWORD"],      //用户ID
            ["szAppCode", "TCHAR"],      //app编码
        ]
    }
    //请求用户换桌
    export let CMD_GP_SuerChangeTable = {
        wMainCmdID: 3,
        wSubCmdID: 17,
        nLenght: 0,
        data: [

        ]
    }

    //银行查询
    export let CMD_GP_QueryInsureInfo = {
        wMainCmdID: 5,
        wSubCmdID: 1,
        nLenght: 1,
        data: [
            ["cbActivityGame", "BYTE"],      //游戏动作
        ]
    }

    //银行取款
    export let CMD_GP_TakeScoreRuest = {
        wMainCmdID: 5,
        wSubCmdID: 3,
        nLenght: 42,
        data: [
            ["cbActivityGame", "BYTE"],      //游戏动作
            ["lTakeScore", "SCORE"],      //取款数目
            ["szInsurePass", "TCHAR", 33],      //银行密码
        ]
    }
    //请求坐下
    export let CMD_GP_SitDownitDown = {
        wMainCmdID: 3,
        wSubCmdID: 3,
        nLenght: 70,
        data: [
            ["wTableID", "WORD"],        //桌子位置
            ["wChairID", "WORD"],        //椅子位置
            ["szPassword", "TCHAR", 33],        //桌子密码
        ]
    }

    //获取游戏配置
    export let CMD_GP_GetGameOption = {
        wMainCmdID: 8,
        wSubCmdID: 1,
        nLenght: 9,
        data: [
            ["cbAllowLookon", "BYTE"],      //旁观标志
            ["dwFrameVersion", "DWORD"],      //框架版本
            ["dwClientVersion", "DWORD"],      //游戏版本
        ]
    }
    //发送用户准备
    export let CMD_GP_SendUserReady = {
        wMainCmdID: 8,
        wSubCmdID: 2,
        nLenght: 0,
        data: [

        ]
    }


    //----------------------------------------------------------------------------------------------------------------
    export let MainCMD_MsgId = {
        1: {
            //登陆成功
            100: [
                ["dwUserRight", "DWORD"],        //用户权限
                ["dwMasterRight", "DWORD"],       //管理权限
            ],
            //登陆失败
            101: [
                ["lErrorCode", "LONG"],        //错误代码
                ["szDescribeString", "CHINESE", 128],       //描述
            ],
            //登陆完成
            102: [

            ],
            //登陆游戏时发现在其他房间
            103: [
                ["wServerID", "WORD"],        //其他游戏房间的serverID
            ],
            //重选服务器-选桌类型
            104: [

            ],
            //升级提示
            200: [
                ["cbMustUpdatePlaza", "BYTE"],        //强行升级
                ["cbMustUpdateClient", "BYTE"],       //强行升级
                ["cbAdviceUpdateClient", "BYTE"],        //建议升级
                ["dwCurrentPlazaVersion", "DWORD"],       //当前版本
                ["dwCurrentFrameVersion", "DWORD"],        //当前版本
                ["dwCurrentClientVersion", "DWORD"],       //当前版本
            ],
        },


        2: {
            //列表配置
            100: [
                ["cbColumnCount", "BYTE"],      //列表数目
                ["ColumnItem", "STRUCT[]", [
                    ["cbColumnWidth", "BYTE"],        //列表宽度
                    ["cbDataDescribe", "BYTE"],        //字段类型
                    ["szColumnName", "CHINESE", 16],       //列表名字
                ], 32],        //列表描述
            ],
            //房间配置
            101: [
                ["wTableCount", "WORD"],        //桌子数目
                ["wChairCount", "WORD"],        //椅子数目
                ["wServerType", "WORD"],        //房间类型
                ["dwServerRule", "DWORD"],        //房间规则
            ],
            //完成配置
            103: [

            ],
            //玩家权限
            104: [
                ["dwUserRight", "DWORD"],        //玩家权限
            ],
        },

        3: {
            //用户规则
            1: [
                ["cbRuleMask", "BYTE"],        //规则掩码
                ["wMinWinRate", "WORD"],        //最低胜率
                ["wMaxFleeRate", "WORD"],        //最高逃率
                ["lMaxGameScore", "LONG"],        //最高分数
                ["lMinGameScore", "LONG"],        //最低分数
                ["szPassword", "TCHAR", 33],        //桌子密码
            ],
            //旁观请求
            2: [

            ],
            //拒绝黑名单坐下
            7: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["dwUserID", "TCHAR", 33],        //用户ID
                ["dwRepulseUserID", "DWORD"]        //用户ID
            ],
            //提出用户
            8: [
                ["dwTargetUserID", "DWORD"],        //用户标识
            ],
            //用户进入
            100: [

            ],
            //用户分数
            101: [
                ["dwUserID", "WORD"],        //桌子位置
                ["UserScore", "STRUCT", [
                    ["lScore", "SCORE"],        //用户分数
                    ["lGrade", "SCORE"],        //用户成绩
                    ["lInsure", "SCORE"],        //用户银行
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwUserMedal", "DWORD"],        //用户奖牌
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "LONG"]        //用户魅力
                ]],        //积分信息
            ],
            //用户状态
            102: [
                ["dwUserID", "DWORD"],        //用户标识
                ["UserStatus", "STRUCT", [
                    ["wTableID", "WORD"],        //桌子索引
                    ["wChairID", "WORD"],        //椅子位置
                    ["cbUserStatus", "BYTE"]        //用户状态
                ]],        //用户状态
            ],
            //请求失败
            103: [
                ["lErrorCode", "BYTE"],        //错误码
                ["szDescribeString", "CHINESE", 256]        //描述信息
            ],
            //踢出用户
            104: [
                ["dwTargetUserID", "DWORD"],        //目标用户
            ],
        },

        4: {
            //桌子信息
            100: [
                ["wTableCount", "WORD"],        //桌子数量
                ["TableStatusArray", "STRUCT[]", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                ], 512] //桌子状态
            ],
            //桌子状态
            101: [
                ["wTableID", "WORD"],        //桌子数量
                ["TableStatus", "STRUCT", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                ]] //桌子状态
            ]

        },
        5: {
            //银行资料返回
            100: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["wRevenueTake", "WORD"],        //税收比列
                ["wRevenueTransfer", "WORD"],        //税收比列
                ["wServerID", "WORD"],        //房间标识
                ["lUserScore", "SCORE"],        //用户金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["lTransferPrerequisite", "SCORE"],        //转账条件
            ],
            //银行操作成功
            101: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lUserScore", "SCORE"],        //身上金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
            //银行操作失败
            102: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lErrorCode", "LONG"],        //错误代码
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
        },

        8: {
            //游戏状态
            100: [
                ["cbGameStatus", "WORD"],        //游戏状态
                ["cbAllowLookon", "DWORD"],        //旁观标志
            ],
            103: [],
            104: [],
            200: [
                ["wType", "WORD"],        //游戏状态
                ["szName", "DWORD"],        //mingzi
                ["wLength", "WORD"],        //游戏状态
                ["szString", "CHINESE", 1024],        //内容
            ],

        }

    }

}